﻿using System;

using Odebrecht.WpfApplication.ViewModels;

namespace Odebrecht.WpfApplication.SampleData
{
    public class TarefaViewModelSampleData : TarefaViewModel
    {
        #region Constructors

        public TarefaViewModelSampleData()
            : base()
        {
            for (int i = 0; i < 100; i++)
            {
                this._listOfTarefa.Add(new Models.TarefaModel
                {
                      TarefaId = i
                    , Nome = string.Format("Tarefa {0}", i)
                    , Inicio = RandomDay()
                    , Termino = RandomDay()
                    , Duracao = (short)new Random().Next(1, 50)
                    , Estimada = false
                    , Inativo = false
                    , ExibirNaLinhaDoTempo = true
                    , OcultarBarra = false
                    , RepresentacaoAcumulada = true
                });
            }
        }

        #endregion Constructors

        #region Methods

        DateTime RandomDay()
        {
            DateTime start = new DateTime(1995, 1, 1);
            Random gen = new Random();

            int range = (DateTime.Today - start).Days;
            return start.AddDays(gen.Next(range));
        }

        #endregion Methods
    }
}